﻿namespace Dissemination.MVC.UnityContrib.Logger
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Interfaces;
    using Types;
    using System.Diagnostics;

    /// <summary>
    /// Debug Logger
    /// </summary>
    public class DebugLogger : ILoggerFacade
    {

        /// <summary>
        /// Logs the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="category">The category.</param>
        /// <param name="priority">The priority.</param>
        public void Log(string message, Category category, Priority priority)
        {
            string msgCategory = string.Format("{0}({1})", category, priority);
            Debug.WriteLine(message, msgCategory);

            // Notify if High Exception
            if (category == Category.Exception && priority == Priority.High)
                Debug.Fail(string.Format("{0}:{1}", msgCategory, message));
        }

    }
}
